home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
Documents
/
NeXTAnswers
/
postscript.798
< prev
next >
Wrap
Text File
|
1992-02-06
|
1KB
|
47 lines
{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f3\fmodern Ohlfs;\f1\fswiss Helvetica;}
\paperw13040
\paperh10800
\margl120
\margr120
{\colortbl\red0\green0\blue0;}
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ul0\fs28\fc0 sending PostScript to the WindowServer\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
Q: How can I send a PostScript file directly to the
\fc0 WindowServer
?\
\
A: You should usually use NXImage. However, if that's not appropriate in your situation use the following code snippet.
Warning: Do
\b not
\b0 use
\b PSRun()
\b0 !\
\
\pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220\f3\fs22\fc0 int SendFileToPS(const char *fileName)\
\{\
NXStream *st;\
char *addr;\
int len, maxlen;\
\
st = NXMapFile(fileName, NX_READONLY);\
if (st) \{\
NXGetMemoryBuffer(st, &addr, &len, &maxlen);\
DPSWriteData(DPSGetCurrentContext(), addr, len);\
NXCloseMemory(st, NX_FREEBUFFER);\
return 0;\
\} else\
return -1;\
\}\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28 \
\fc0 \
QA798\
\
Valid for 1.0\
Valid for 2.0\
\